package com.atguigu.fruit.util;

import com.google.gson.Gson;

public class GsonUtil {
    public static String toJson(Object object) {
        Gson gson = new Gson();
        String json = gson.toJson(object);
        return json;
    }

    public static <T> T fromJosn(String s, Class<T> tClass) {
        Gson gson = new Gson();
       return gson.fromJson(s, tClass);
    }
}
